Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use new geolookup api #1158

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

use new geolookup api #1158

wants to merge 17 commits into from

Conversation

garmr-ulfr
Copy link
Contributor

@garmr-ulfr garmr-ulfr commented Aug 27, 2024

The geolocation, user info, and proxy config requests in flashlight have been merged into a single request. The new flashlight/geolookup now only stores the IP and country and Refresh has been removed.

This PR relies on flashlight PR and, as such, is using that branch. Once the flashlight PR is merged, this will need to be updated to use the main branch again before this can be merged.

@garmr-ulfr garmr-ulfr marked this pull request as ready for review October 22, 2024 21:01
@garmr-ulfr garmr-ulfr requested a review from a team October 22, 2024 21:08
@@ -94,6 +93,10 @@ func TestProxying(t *testing.T) {
newResult, err := Start("testapp", "en_US", testSettings{}, testSession{})
require.NoError(t, err, "Should have been able to start lantern twice")
require.Equal(t, result.HTTPAddr, newResult.HTTPAddr, "2nd start should have resulted in the same address")

// give the client time to initialize. This helps with consistency in tests
time.Sleep(1 * time.Second)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there something you can expose to synchronize on that will guarantee that it's initialized? Sleeping in tests is always a bad idea and the tests are already super flakey.

@@ -160,7 +163,7 @@ func testProxiedRequest(helper *integrationtest.Helper, proxyAddr string, dnsGra

var buf []byte

buf, err = ioutil.ReadAll(res.Body)
buf, err = io.ReadAll(res.Body)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a sanity check to the length of the body here? Just check Response.ContentLength or whatever it's called, or add a io.LimitReader to some reasonably (large) value? Although I do see a timeout above, if it applies to body reading then it's moot.

Copy link
Contributor Author

@garmr-ulfr garmr-ulfr Oct 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It think it applies to the entire request, including reading the body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants